{% load static %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{% block title %}{% endblock %}-蒋维博客</title>

    <!-- 引入本地的 Bootstrap CSS 和 JS-->
    <link href="{% static 'bootstrap5/css/bootstrap.min.css' %}" rel="stylesheet">
    <script src="{% static 'bootstrap5/js/bootstrap.bundle.min.js' %}"></script>
    <!-- 对body进行渲染-->
    <link rel="stylesheet" href="{% static 'css/base.css' %}">
    <link rel="stylesheet" href="">
    <!-- 添加其他样式-->
    {% block head %}{% endblock %}
</head>
<body>
<!-- 页面内容 -->

<!-- Bootstrap header -->
<header class="p-3 text-bg-light border-bottom">
    <div class="container">
        <div class="d-flex flex-wrap align-items-center justify-content-center justify-content-lg-start">
            <a href="/" class="d-flex align-items-center mb-2 mb-lg-0 text-white text-decoration-none">
                <img src="{% static 'images/logo.png' %}" width="40" height="32" alt="">
            </a>

            <ul class="nav col-12 col-lg-auto me-lg-auto mb-2 justify-content-center mb-md-0">
                <li><a href="{% url 'app1:index' %}" class="nav-link px-2 text-secondary">首页</a></li>
                <li><a href="{% url 'app1:pub_blog' %}" class="nav-link px-2 text-secondary">发布博客</a></li>
            </ul>
            <form class="col-12 col-lg-auto mb-3 mb-lg-0 me-lg-3" role="search" action="{% url 'app1:search' %}" method="get">
                <input type="search" class="form-control" placeholder="搜索..." aria-label="Search" name="kw">
            </form>

            {% if user.is_authenticated %}
                <div class="dropdown text-end">
                    <a href="#" class="d-block link-body-emphasis text-decoration-none dropdown-toggle"
                       data-bs-toggle="dropdown" aria-expanded="false">
                        <img src="{% static 'images/avatar.png' %}" alt="mdo" width="32" height="32" class="rounded-circle">
                    </a>
                    <ul class="dropdown-menu text-small" style="">
                        <li><a class="dropdown-item" href="{% url 'app1:logout_view' %}">退出登录</a></li>
                    </ul>
                </div>
            {% else %}
                <div class="text-end">
                    <a href="{% url 'app1:register' %}" class="btn btn-outline-primary me-2">注册</a>
                    <a href="{% url 'app1:bloglogin' %}" class="btn btn-primary">登录</a>
                </div>
            {% endif %}


        </div>
    </div>
</header>

<!-- Bootstrap container -->
<main class="container text-bg-light mt-4 p-3 rounded">
    {% block main %}{% endblock %}
</main>

</body>
</html>
